﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;

namespace MyTimeLine
{
    /// <summary>
    /// MainWindow.xaml 的交互逻辑
    /// </summary>
    public partial class MainWindow : Window, INotifyPropertyChanged
    {
        public MainWindow()
        {
            InitializeComponent();
            showtime();
        }


        public void showtime()
        {
            foreach (Date item in TimeLine.Select_Months)
            {
                Time_Months = item.Time_Years.ToString() + " ";
            }
            foreach (Date item in TimeLine.Select_Years)
            {
                Time_Years = item.Time_Years ;
            }
        }


        public event PropertyChangedEventHandler PropertyChanged;

        public void OnPropertyChanged(PropertyChangedEventArgs e)
        {
            if (PropertyChanged != null)
            {
                PropertyChanged(this, e);
            }
        }
        /// <summary>
        /// 月份
        /// </summary>
        private string timeMonths;
        public string Time_Months
        {
            get { return timeMonths; }
            set
            {
                timeMonths = value;
                //RaisePropertyChanged("Time_Months");
                OnPropertyChanged(new PropertyChangedEventArgs("Time_Months"));
            }
        }
        /// <summary>
        /// 年份
        /// </summary>
        private int timeYears;
        public int Time_Years
        {
            get { return timeYears; }
            set
            {
                timeYears = value;
                OnPropertyChanged(new PropertyChangedEventArgs("Time_Years"));

                // RaisePropertyChanged("Time_Years");
            }
        }
      
    }
}
